package cn.com.cifi.mars.web.action.sys;

import java.util.List;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.com.cifi.mars.bean.vo.sys.rsp.UserRoleVo;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import cn.com.cifi.mars.entity.common.IdmUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(tags = {"系统管理"})
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/sys/userRole")
public interface ISysUserRoleController {

	 
	 @ApiOperation(value = "权限管理-分配用户分页", notes = "本地用户信息分页")
	 @GetMapping(value = "page")
	 public R<UserRoleVo> getUserRolePageList(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
	            @ApiParam(value = "当前第几页", required = true, defaultValue = "1") @RequestParam(value = "current") String current,
	            @ApiParam(value = "每页条数", required = true, defaultValue = "2") @RequestParam(value = "pageSize") String pageSize,
	            @ApiParam(value = "角色id" , required = true) @RequestParam(name = "roleId", defaultValue = "") String roleId);
	 
	 @ApiOperation(value = "权限管理-移除用户", notes = "权限管理-移除用户")
	 @DeleteMapping(value = "{id}")
	 public R<String> deleteUserRole(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
	            @ApiParam(value = "用户角色关联表id" , required = true, defaultValue = "-1") @RequestParam(name = "id") String id);
	 
	 
	 @ApiOperation(value = "权限管理-选择用户", notes = "权限管理-选择用户")
	 @ApiImplicitParam(name="userIds", value="用户ID数组集", required=true, paramType="query" ,allowMultiple=true, dataType = "String")
	 @PostMapping(value = "")
	 public R<String> createUserRole(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
	            @ApiParam(value = "用户数组id" , required = true, defaultValue = "-1") @RequestParam(name = "userIds") List<String> userIds,
	            @ApiParam(value = "角色id" , required = true, defaultValue = "-1") @RequestParam(name = "roleId") String roleId);

	 @ApiOperation(value = "查询用户拥有多少角色", notes = "查询用户拥有多少角色")
	 @GetMapping(value = "list")
	 public R<UserRoleVo> getUserRoleList(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
	            @ApiParam(value = "用户id" , required = true) @RequestParam(name = "userId", defaultValue = "") String userId);
	 
	 
	 
}
